﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Workflow.ComponentModel;
using System.ComponentModel;
using System.Windows.Forms;

namespace ExternalActivities
{
	public class MessageIOActivity : Activity
	{
        public MessageIOActivity()
        {
        }

        public MessageIOActivity( string name ) : base( name )
        {
        }

        public static readonly DependencyProperty InMsgProperty = DependencyProperty.Register( "InMsg", typeof( string ), typeof( MessageIOActivity ) );

        [DesignerSerializationVisibility( DesignerSerializationVisibility.Visible )]
        [Browsable( true )]
        public string InMsg
        {
            get { return (string) GetValue( InMsgProperty ); }
            set { SetValue( InMsgProperty, value ); }
        }

        public string OutMsg { get; set; }

        protected override ActivityExecutionStatus Execute( ActivityExecutionContext aec )
        {
            MessageBox.Show( InMsg );

            OutMsg = InMsg.ToUpper();

            return ActivityExecutionStatus.Closed;
        }
    }
}
